package com.saltedfish.tool.dialog;

import android.app.Activity;
import android.text.TextUtils;
import android.widget.TextView;

import com.saltedfish.tool.R;

import butterknife.BindView;
import cn.droidlover.xdroidmvp.popwindow.DialogHelper;


public class LoadingDialogs extends DialogHelper {

    public static LoadingDialogs dialog;
//
    @BindView(R.id.tv_loads)
    TextView tv_load;

    public LoadingDialogs(Activity context) {
        super(context, R.style.no_bg_dialog);
        getDialog().setCanceledOnTouchOutside(false);
    }

    public static LoadingDialogs getInstance(Activity context) {
        if (dialog == null) {
            dialog = new LoadingDialogs(context);
        }

        return dialog;
    }

    public void setContent(String content) {
        if (!TextUtils.isEmpty(content)) {
            tv_load.setText(content);
        }
    }


    @Override
    protected int getLayoutId() {
        return R.layout.dialog_loadings;
    }

    @Override
    protected void initView() {

    }

    @Override
    public void dismiss() {
        super.dismiss();
        dialog = null;
    }

    @Override
    protected void initData() {

    }

    @Override
    protected void dialogDismiss() {

    }
}
